package com.kingbi.system.people.service;

import java.sql.SQLException;
import java.util.List;


import com.kingbi.system.people.jsfBean.PeopleDataBean;
import com.kingbi.system.people.model.PeopleModel;
import com.kingbi.system.userRole.model.UserRoleModel;

public interface PeopleService {
	
	/**
	 * 修改之前
	 * @param packModel
	 */
	
	void saveUser(PeopleModel peopleModel,String[] roles) throws SQLException;
	/**
	 * 添加记录
	 * @param packModel
	 */
	void savePeople(PeopleModel peopleModel) ;
	/**
	 * 根据unitID删除一条记录
	 * @param packID
	 */
	void deletePeople(String userID) ;
	/**
	 * 分页查询机构
	 * @param page
	 * @param max
	 * @return
	 */
	List<PeopleModel> listPeople(PeopleModel peopleModel,int start,int max) ;
	/**
	 * 获取符合条件的总记录数
	 * @param IndicatorModel
	 * @return
	 */
    long queryCount(PeopleModel peopleModel);
	/**
	 * 根据orgCode读取一条记录
	 * @param unitID
	 * @return
	 */
	PeopleModel loadUnit(String userID);
	
	/**
     * 获取角色表的数据
     * 
     * @throws SQLException
     */
    List<Object> loadRole()throws SQLException ;
    
    /**
     * 获得用户的角色
     * 
     * @param userId
     * @return
     * @throws SQLException
     */
    List<Object> loadUserRole(String userId) throws SQLException;
    
    /**
     * 根据用户的ID 查询角色表和用户角色表，拼凑成JSON串，返回页面
     * 
     * @return
     * @throws SQLException
     */
    String getCheckboxStr(String userId) throws SQLException;
    
    /**
     * 添加用户及角色
     * 
     * @param packModel
     * @param roles
     */
    void savePeopleRole(UserRoleModel userRoleModel) throws SQLException;
    
    /**
     * 根据用户编号查新用户Model
     * @param userId 用户编号
     * @return
     * @throws SQLException
     */
    public PeopleModel LoadUserBySQL(String userId) throws SQLException;
    public PeopleDataBean findUserInfo(String userId) throws SQLException;
    
    /**
     * 封装用户信息 分页
     * @param pageRecord 每页行数
     * @param currentPage 当前第几页
     * @return
     * @throws SQLException
     */
    List<PeopleDataBean> getUserItems(String queryCond ,int pageRecord, int currentPage,long count) throws SQLException;
    
    public long queryUserCount(String queryStr) throws SQLException;
    
    public int getMaxId ();
    
    //修改密码
    public void setPassword(PeopleModel peopleModel) throws SQLException;
    
}
